import { request } from "./com";
export const newTask = async (user_id: number, name: string, des: string, points: number) => {
    const response = await request.post('api/tasks', {

        user_id: user_id,
        task_name: name,
        description: des,
        points: points

    })
    return response
}
export const putTask = async (task_id: number, name?: string, des?: string, points?: number) => {
    const response = await request.put(`api/tasks/${task_id}`, {

        task_name: name,
        description: des,
        points: points

    })
    return response
}
export const completedTask = async (task_id: number, user_id: number) => {
    const response = await request.post(`api/tasks/${task_id}/complete`, {

        task_id: task_id,
        user_id: user_id

    })
    return response
}
export const getTaskList = async (user_id: number) => {
    const response = await request.get('api/tasks', {
        params: {

            user_id: user_id
        }

    })
    return response
}